package com.clz.hyperit.service.impl;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.clz.hyperit.dao.PositionDao;
import com.clz.hyperit.entity.Position;
import com.clz.hyperit.service.PositionService;
@Service("positionService")
public class PositionServiceImpl implements PositionService {
	private static Logger logger = LoggerFactory
			.getLogger(QuestionServiceImpl.class);
	@Autowired
	private	PositionDao positionDao;
	
	public Integer savePosition(Position position) {
		return positionDao.save(position);
	}
	
	public Position getByName(String name) {
		return positionDao.getByName(name);
	}

	public void deletePosition(Position position) {
		positionDao.deleteById(position.getId());
	}

	public void updatePosition(Position position) {
		positionDao.updateWithNotNullProperties(position);
	}

	public List<Position> findPosition() {
		return positionDao.findAll();
	}

	public Position findById(Integer id) {
		return positionDao.get(id);
	}
}
